﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace UI
{
    public class BasePage : System.Web.UI.Page
    {
        public static UserInfo GetUserInfo()
        {
            var model = new UserInfo();
            var cookie = HttpContext.Current.Request.Cookies["UserInfo"];
            if (cookie != null)
            {
                model.Number = cookie["number"] ?? "";
                model.Name = cookie["name"] ?? "无";
            }
            else
            {
                HttpContext.Current.Response.Redirect("Login/Login.html");
            }
            return model;
        }

    }

    public class UserInfo
    {
        public string Number { get; set; }
        public string Name { get; set; }
        public int Sex { get; set; }
        public int AddTime { get; set; }
        public int UpdateTime { get; set; }
    }
}